const LayerLink = ({ title, component, data = {}, onClick, children, ...others }) => {
  const doClick = (evt) => {
    evt.preventDefault();
    onClick({
      title: title === undefined ? children : title,
      component,
      props: data
    });
  };

  return <a {...others} onClick={doClick}>{children}</a>;
};

export default LayerLink;
